package com.atguigu.crud.controller;

import com.atguigu.crud.bean.Msg;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.PostConstruct;


@RequestMapping("/student")
@Controller
public class StudentController {

    @PostConstruct
    public void init() {
        System.out.println("------------init------------");
    }

    @ResponseBody
    @RequestMapping
    public Msg getStudent() {
        Msg msg = Msg.success().add("id", 10001).add("name", "张三");
        return msg;
    }
}
